﻿@{
    ViewBag.Title = "会员角色管理";
    Layout = "~/Views/Shared/_LayoutIndex.cshtml";
}
<script>
    $(function () {
        $('#layout').layout();
        gridList();
    });
    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            height: $(window).height() - 96,
            url: '/BizManage/Statics/GetGridJson?itemId=dd3f3919-e568-476c-b0d6-7618fa6557eb',
            colModel: [
                { label: "主键", name: "F_Id", hidden: true, key: true },
                { label: '名称', name: 'F_ItemName', width: 150, align: 'left' },
                { label: '编号', name: 'F_ItemCode', width: 150, align: 'left' },
                { label: '排序', name: 'F_SortCode', width: 80, align: 'center' },
                {
                    label: "默认", name: "F_IsDefault", width: 60, align: "center",
                    formatter: function (cellvalue) {
                        return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
                    }
                },
                {
                    label: '创建时间', name: 'F_CreatorTime', width: 80, align: 'left',
                    formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' }
                },
                {
                    label: "有效", name: "F_EnabledMark", width: 60, align: "center",
                    formatter: function (cellvalue) {
                        return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
                    }
                },
                { label: "备注", name: "F_Description", index: "F_Description", width: 200, align: "left", sortable: false }
            ]
        });
        //$gridList.jqGrid('setGridParam', {
        //    postData: { itemId: "dd3f3919-e568-476c-b0d6-7618fa6557eb", keyword: "" },
        //}).trigger('reloadGrid');
    }
   
    function btn_edit() {
        var keyValue = $("#gridList").jqGridRowValue().F_Id;
        $.modalOpen({
            id: "Form",
            title: " 修改会员级别名称",
            url: "/BizManage/Statics/MeneberForm?keyValue=" + keyValue,
            width: "450px",
            height: "350px",
            callBack: function (iframeId) {
                top.frames[iframeId].submitForm();
            }
        });
    }
    
</script>
<div class="ui-layout" id="layout" style="height: 100%; width: 100%;">
    <div class="ui-layout-center">
        <div class="topPanel">
            <div class="toolbar">
                <div class="btn-group">
                    <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
                </div>
                <div class="operate">
                    <ul class="nav nav-pills">
                        <li class="first">已选中<span>1</span>项</li>
                        <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改字典</a></li>
                    </ul>
                    <a href="javascript:;" class="close"></a>
                </div>
                @*<script>$('.toolbar').authorizeButton()</script>*@
            </div>
            <div class="search">
                <table>
                    <tr>
                        <td>
                            
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="gridPanel">
            <table id="gridList"></table>
        </div>
    </div>
</div>
